package com.web.onirigi.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.web.onirigi.dao.FranchiseeDao;
import com.web.onirigi.model.FranchiseeBean;
import com.web.onirigi.service.FranchiseeService;

@Service
public class FranchiseeServiceImpl implements FranchiseeService {

	@Autowired
	private FranchiseeDao  franchiseeDao;
	
	@Override
	public List<FranchiseeBean> getOFranchiseeBeans(FranchiseeBean bean) {
		if(bean.getPageNum() !=null) {
			PageHelper.startPage(bean.getPageNum(), bean.getPageSize());
		}
		return franchiseeDao.getOFranchiseeBeans(bean);
	}

	@Override
	public Integer addFranchiseeBean(FranchiseeBean bean) {
		bean.setCreateTime(new Date());
		return franchiseeDao.addFranchiseeBean(bean);
	}

	@Override
	public Integer deleteFranchiseeBean(FranchiseeBean bean) {
		return franchiseeDao.deleteFranchiseeBean(bean);
	}

	@Override
	public Integer updateFranchiseeBean(FranchiseeBean bean) {
		return franchiseeDao.updateFranchiseeBean(bean);
	}

}
